Khong duoc tat, dang chay autosendmail <br/>

<form name="Form1"> 
<input type="text" size="8" name="Clock" id="clock"> 
<input type="button" id="option" onclick="TuyChinh()" value="Stop">
</form> 
<div id="sendmail">

</div>
<script> 
var co=1;
var SD;

function sendmail()
{
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}else{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function(){
											  if (xmlhttp.readyState==4 && xmlhttp.status==200){
											    	document.getElementById("sendmail").innerHTML+=xmlhttp.responseText;
											    	SD=window.setTimeout("update()",1000); 
											  }
									  }
	xmlhttp.open("POST","sendmail_approve.php",true);
	xmlhttp.send();
}
function update() 
{ 
var today=new Date(); 
var hours=today.getHours(); 
var minutes=today.getMinutes(); 
var seconds=today.getSeconds(); 
if (hours<10) 
hours="0"+hours; 
if (minutes<10) 
minutes="0"+minutes; 
if (seconds<10) 
seconds="0"+seconds; 
document.getElementById("clock").value=hours+":"+minutes+":"+seconds; 

sendmail();


} 
update(); 
function TuyChinh() 
{ 
	if(co==1){
		co=0;
		window.clearTimeout(SD);
		document.getElementById("option").value="Start";
	}
	else{
		co=1;
		update();
		document.getElementById("option").value="Stop";
	}
} 

</script> 